#include "widget.h"
#include <QApplication>
#include "cqtgpsSingle.h"
#include "cdaccontrolersingle.h"
#include "cdcelecenermetersingle.h"
#include "form1.h"
#include <QDebug>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    CQtGpsSingle::GetSingelton()->setSerialPara("ttyAMA4",QSerialPort::Baud38400);
    // qDebug()<< CQtGpsSingle::GetSingelton()->open(QIODevice::ReadWrite);
    CDacControlerSingle::GetSingelton()->write("open gps :");
    CQtGpsSingle::GetSingelton()->open(QIODevice::ReadWrite);
    //CDacControlerSingle::GetSingelton()->write(QString::number( CQtGpsSingle::GetSingelton()->open(QIODevice::ReadWrite)).);
    CQtGpsSingle::GetSingelton()->write("123");
    CQtGpsSingle::GetSingelton()->write("123");

    CDacControlerSingle::GetSingelton()->setSerialPara("ttyAMA3",QSerialPort::Baud38400);
    CDacControlerSingle::GetSingelton()->open(QIODevice::ReadWrite);
    CDacControlerSingle::GetSingelton()->set1RoadDacOutput(3.5);

    CDCElecEnerMeterSingle::GetSingelton()->setSerialPara("ttyAMA2",QSerialPort::Baud2400);
    CDacControlerSingle::GetSingelton()->open(QIODevice::ReadWrite);


    //    Widget w;
    //    w.show();

    Form1 f1; //测试电能表通信
    f1.show();

    return a.exec();
}
